home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Purity / Purity #34 (1994-08)(Diesel)(DE)[WB].zip / Purity #34 (1994-08)(Diesel)(DE)[WB].adf / AppIcon / AppIcon2.p < prev    next >
Text File  |  1994-08-06  |  3KB  |  115 lines

  1. { Proramm:   AppIcon2
  2.  
  3.   Version:   0.04
  4.  
  5.   Datum:     16.06.94
  6.  
  7.   Sprache:   KickPascal 2.12/OS2-Includes
  8.  
  9.   Sinn:      Programm zeigt wie man ein eigenes  AppIcon auf der WB
  10.              programmiert und wie man mit selbigen arbeitet
  11.  
  12.   Autor:     PackMAN
  13.              c/o Falk Zühlsdorff
  14.              Lindenberg 66
  15.              D-98693 Ilmenau/Thüringen
  16.  
  17.   ©:         Routinen:- FREEWARE wenn Name des Autors im Info-
  18.                         fenster angegeben ist und selbigem das
  19.                          Programm zugesendet wird.
  20.  
  21.              Image:   - Icon für "CD pro" darf nicht weiter-
  22.                         veröffentlicht wird.
  23.  
  24.   Kommentar: nur für Purity-Pascal-PD-Serie                             }
  25.  
  26. PROGRAM appicon2;
  27. USES EXEC;
  28. {$INCL 'dos.lib',
  29.        'workbench/startup.h',
  30.        'workbench/workbench.h',
  31.        'icon.lib',
  32.        'wb.lib'}
  33.  
  34. TYPE    ifeld=array[1..24] of long;     {für Image}
  35.  
  36. VAR dobj       : p_DiskObject;
  37.     pjobj      : DiskObject;
  38.     myPort     : p_MsgPort;
  39.     MyAppIcon  : p_AppIcon;
  40.     AppMsg     : p_AppMessage;
  41.     ex         : boolean;
  42.     Gad        : Gadget;
  43.     Image1     : Image;
  44.     idat1      : ^ifeld;
  45.  
  46. BEGIN
  47.  IconBase:=OpenLibrary('icon.library',37);
  48.  IF IconBase<>NIL
  49.   THEN
  50.    BEGIN
  51.     workbenchbase:=OpenLibrary('workbench.library',37);
  52.      IF workbenchbase<>NIL
  53.       THEN
  54.        BEGIN
  55.  
  56.         idat1:=ptr(alloc_mem(sizeof(ifeld),2)); {Chip}
  57.           idat1^:=ifeld(
  58.         %000000000000000000000000000000,
  59.         %000000000000000000000011100000,
  60.         %000000000000000000000111110000,
  61.         %000000000100000000000111100000,
  62.         %000000000110000000000100000000,
  63.         %000000000101000000000100000000,
  64.         %000000000101000000000100000000,
  65.         %000000000100000000000100000000,
  66.         %000000000100000000000100000000,
  67.         %000000111000000000000100000000,
  68.         %000001111100000000000000000000,
  69.         %000000111000000000000000000000,
  70.         %000000000000000000000000000000,
  71.         %000000000000000001000000000000,
  72.         %000000000000000001100000000000,
  73.         %000000000000000001010000000000,
  74.         %000000000000000001010000000000,
  75.         %000000000000000001000000000000,
  76.         %000000000000000001000000000000,
  77.         %000000000000001110000000000000,
  78.         %000000000000011111000000000000,
  79.         %000000000000001110000000000000,
  80.         %000000000000000000000000000000,
  81.         %000000000000000000000000000000);
  82.         Image1:=image(0,0,32,24,1,idat1,1,2,nil);
  83.  
  84.         Gad:=Gadget(NIL,50,50,32,25,GADGIMAGE+GADGIMAGE,GADGIMMEDIATE+
  85.                     RELVERIFY,BOOLGADGET,^Image1,NIL,NIL,0,NIl,0,NIL);
  86.         pjobj:=diskobject(WB_DISKMAGIC,WB_DISKVERSION,Gad,WBAPPICON,
  87.                           NIL,NIL,NO_ICON_POSITION,NO_ICON_POSITION,
  88.                           NIL,NIL,4000);
  89.         dobj:=^pjobj;
  90.         ex:=false;
  91.         myport:=CreateMsgPort;
  92.         myappicon:=AddAppIconA(0,0,'PackMANs_AppIcon',myport,NIL,dobj,NIL);
  93.         {IF myAppIcon<>NIL
  94.          THEN writeln('AppIcon on the WBScreen');}
  95.         REPEAT
  96.          AppMsg:=wait_port(myport);
  97.          AppMsg:=get_msg(myport);
  98.          Reply_Msg(AppMsg);
  99.          IF AppMsg^.am_NumArgs=0
  100.           THEN ex:=true; {Doppelklick/aktiv}
  101.         UNTIL ex;
  102.         ex:=RemoveAppIcon(myAppIcon);
  103.         DeleteMsgPort(myport);
  104.        END;
  105.    END;
  106. END.
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.